package com.acol.util;

import javax.mail.PasswordAuthentication;

/**
* SimpleAuthenticator is used to do simple authentication
* when the SMTP server requires it.
*/
public class SMTPAuthenticator extends javax.mail.Authenticator
{
	private String usuario;
	private String senha;

    public PasswordAuthentication getPasswordAuthentication()
    {
        String username = usuario;
        String password = senha;
        return new PasswordAuthentication(username, password);
    }
    
    public PasswordAuthentication getPasswordAuthentication(String user, String pasw)
    {
    	usuario = user;
    	senha = pasw;
        String username = usuario;
        String password = senha;
        return new PasswordAuthentication(username, password);
    }

	public String getSenha() {
		return senha;
	}

	public void setSenha(String senha) {
		this.senha = senha;
	}

	public String getUsuario() {
		return usuario;
	}

	public void setUsuario(String usuario) {
		this.usuario = usuario;
	}
    
}